home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / unasc.pl < prev    next >
Perl Script  |  1991-04-12  |  338b  |  23 lines

  1. #!/usr/unsup/perl
  2.  
  3. # unasc
  4.  
  5. # A perl program to extract a HP-48 binary from a text file containing a 
  6. # ->ASC program. 
  7. #
  8. # Usage: unasc file > binfile
  9. #
  10. # Written by Wayne Scott  1990
  11.  
  12. while (<>) {
  13.     next if (!(/^%%HP/../"$/));
  14.     chop;
  15.     $file .= $_;
  16. }
  17.  
  18. $file =~ s/.*"(\w*)\w{4}".*/$1/;
  19.  
  20. $file =~ s/(..)/pack("C",hex($1))/eg;
  21.  
  22. print $file;
  23.